import { randomWord } from '@/utils/utils'

/** 注释
 * @Author FiveXu(316643470@qq.com)
 * @Description: chatDB
 * @Date  2023-10-15 22:49
 */
export interface IChat {
  readonly id: string
  readonly content: string
  readonly user: string
  readonly avatar: string
  type: 'sender' | 'from' | 'date'
  userListDate?: string
  date: string
}

export interface IChatDB {
  readonly id: string
  readonly name: string
  readonly avatar: string
  list: IChat[]
}

export interface IChatDBList {
  chatDB: IChatDB[]
}

export default {
  chatDB: [
    {
      id: 'Fivexu',
      name: 'Fivexu',
      avatar: 'avatar.jpg',
      list: [
        {
          id: randomWord(20, 'chat-'),
          type: 'sender',
          content: '您好!',
          user: 'Fivexu',
          date: '2023/10/15 10:00:00',
          avatar: 'avatar'
        },
        {
          id: randomWord(20, 'chat-'),
          type: 'from',
          content: '您好!',
          user: 'Fivexu',
          date: '2023/10/15 10:00:00',
          avatar: 'avatar'
        }
      ]
    },
    {
      id: 'fileTransfer',
      name: '文件传输助手',
      avatar: 'file-transfer.png',
      list: [
        {
          id: randomWord(20, 'chat-'),
          type: 'sender',
          content: 'Test',
          user: 'Fivexu',
          date: '2023-10-14 10:00:00',
          avatar: 'avatar'
        },
        {
          id: randomWord(20, 'chat-'),
          type: 'sender',
          content: '您好!',
          user: 'Fivexu',
          date: '2023-10-16 10:00:00',
          avatar: 'avatar'
        }
      ]
    }
  ]
} as IChatDBList
